//
//  JHSSicknessDetailController.m
//  detailVC
//
//  Created by chenWei on 2017/3/22.
//  Copyright © 2017年 陈伟. All rights reserved.
//

#import "JHSSicknessDetailController.h"
#import "Masonry.h"
#import "JHSMutiSickController.h"
#import "UILabel+HMAddition.h"
#import "JHSSickTypeController.h"
#import "JHSSicknessDetailView.h"
#import "JHSDoctorApplyViewController.h"
#import "SVProgressHUD.h"
#import "JHSOnceCureViewController.h"

@interface JHSSicknessDetailController ()<UIGestureRecognizerDelegate,JHSSickTypeControllerDelegate,JHSMutiSickControllerDelegate,JHSOnceCureViewControllerDelegate>

@property (nonatomic, weak) UIView *fiveV;
@property (nonatomic, weak) UILabel *piPeiLab;
@property (nonatomic, weak) UILabel *doctorCountLab;
@property (nonatomic, weak) UIImageView *iconV;
@property (nonatomic, weak) UIButton *selectBtn;
@property (nonatomic,weak) UILabel *methodLab;

//--下面是--赋值跳转属性  methodLab
@property (nonatomic,weak) UILabel *typeLab;

//--重新计算frame，自动布局
@property (nonatomic,weak) UIView *secondV;
@property (nonatomic,weak) UILabel *mutiLab;

//--重新设置属性的控件
@property (nonatomic,weak) UIButton *yuYueBtn;
@property (nonatomic,weak) UIButton *chooseBtn1;
@property (nonatomic,weak) UIButton *chooseBtn2;
@property (nonatomic,weak) UIButton *chooseBtn3;
@property (nonatomic,weak) UIButton *chooseBtn4;

@end

@implementation JHSSicknessDetailController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.syndromeTypeModelArr=[NSMutableArray array];
    
    [self setTitleName];
    
    self.navigationItem.backBarButtonItem.tintColor=[UIColor whiteColor];
    
    [self setupUI];
    
}




//设置导航标题
-(void) setTitleName{
    
    //tag说明   1为肿瘤 4为血液科 2为心血管  3为神经科  5为骨科  6为公益
    switch (self.btnTag) {
        case 1:
            self.navigationItem.title=@"肿瘤";
            break;
        case 2:
            self.navigationItem.title=@"心血管";
            break;
        case 3:
            self.navigationItem.title=@"神经科";
            break;
        case 4:
            self.navigationItem.title=@"血液科";
            break;
        case 5:
            self.navigationItem.title=@"骨科";
            break;
        default:
            break;
    }
}

//MARK:实现疾病治疗方式回传--代理方法
-(void) setOnceCure:(JHSOnceCureViewController *)vc withModel:(JHSOnceCureTypeModel *)model{
//    NSLog(@"%@-------",model);
//    NSLog(@"%@-------",model.once_type_name);
    _methodLab.text=model.once_type_name;
    
    
}

//MARK:实现疾病小类回传---代理方法
-(void) setMutiSick:(JHSMutiSickController *)vc withModels:(NSArray<JHSSyndromeTypeModel *> *)modelArr{
//    NSLog(@"数据回来了");
//    NSLog(@"%@",modelArr);
    if (modelArr!=nil) {
        _syndromeTypeModelArr=modelArr.mutableCopy;

        _mutiLab.text=@"";
        int __block index = 0;
        for (int i=0; i<modelArr.count; i++) {
            //循环创建label
            UILabel *label = [UILabel hm_labelWithText:modelArr[i].complication_name fontSize:15 color:[UIColor whiteColor]];
            [_secondV addSubview:label];
            label.backgroundColor = JHSMainColor;
            label.textAlignment = NSTextAlignmentCenter;
            CGFloat width = 55;
            CGFloat height = 20;
            CGFloat x = 8;
            CGFloat y = 10;
            label.frame = CGRectMake(x+(width+5)*index, y, width, height);
            label.layer.cornerRadius = 6;
            label.layer.masksToBounds = YES;
            index++;
        }
    }


}


//MARK:实现疾病大类回传---代理方法
-(void) setSickType:(JHSSickTypeController *)vc withModel:(JHSSicknessTypeModel *)model{
    _typeLab.text=model.ci3_name;
    _sicknessTypeModel=model;
    
    _secondV.userInteractionEnabled=YES;//打开view用户交互

    
    
}


//允许多个手势
- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer
{
    return YES;
}



//MARK:创建及添加子控件
- (void)setupUI
{
    self.view.backgroundColor = [UIColor colorWithRed:239 / 255.0 green:239 / 255.0 blue:243 / 255.0 alpha:1];
    
    //MARK:病型标签
    UILabel *lab = [[UILabel alloc]init];
    switch (self.btnTag) {
        case 11:
            lab.text=@"疾病类型：肿瘤";
            break;
        case 12:
            lab.text=@"疾病类型：血液科";
            break;
        case 13:
            lab.text=@"疾病类型：神经科";
            break;
        case 14:
            lab.text=@"疾病类型：心血管";
            break;
        case 15:
            lab.text=@"疾病类型：骨科";
        case 16:
            lab.text=@"公益";
            break;
        default:
            break;
    }
    [lab sizeToFit];
    lab.textColor = [UIColor darkGrayColor];
    [self.view addSubview:lab];
    [lab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.offset(30);
        make.top.offset(18);
    }];
    
    
    //添加手势
    UITapGestureRecognizer *tap1 = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(tap1:)];
    UITapGestureRecognizer *tap2 = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(tap2:)];
    UITapGestureRecognizer *tap5 = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(tap5:)];

    
    //MARK:疾病类型大类---第一个：UIImageView
    UIView *firstV = [[UIView alloc]init];
    firstV.backgroundColor = [UIColor whiteColor];
    firstV.layer.cornerRadius = 5;
    firstV.layer.masksToBounds = YES;
    //给第一个 view 添加手势
    [firstV addGestureRecognizer:tap1];
    [self.view addSubview:firstV];
    [firstV mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.offset(25);
        make.top.equalTo(lab.mas_bottom).offset(26);
        make.right.offset(-25);
        make.height.offset(35.5);
    }];
    
    //在 imgV上添加 lab,btn
    UILabel *typeLab = [[UILabel alloc]init];
    typeLab.text = @"请选择疾病类型:";
    typeLab.textColor = [UIColor colorWithRed:116 / 255.0 green:191 / 255.0 blue:159 / 255.0 alpha:1];
    [typeLab sizeToFit];
    
    [firstV addSubview:typeLab];
    [typeLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.offset(5);
        make.centerY.equalTo(firstV.mas_centerY).offset(0);
    }];
    _typeLab=typeLab;
    
    
    UIButton *btn = [[UIButton alloc]init];
    [btn setImage:[[UIImage imageNamed:@"position-right"]imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal] forState:UIControlStateNormal];

    [firstV addSubview:btn];
    
    [btn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.offset(20);
        make.centerY.equalTo(firstV.mas_centerY).offset(0);
        make.size.mas_offset(CGSizeMake(30, 40));
    }];
    
    //MARK:病例类型小类---第二个：UIImageView
    UIView *secondV = [[UIView alloc]init];
    secondV.backgroundColor = [UIColor whiteColor];
    secondV.layer.cornerRadius = 5;
    secondV.layer.masksToBounds = YES;
//    secondV.userInteractionEnabled=NO;
    //给第二个 view添加手势
    [secondV addGestureRecognizer:tap2];
    [self.view addSubview:secondV];
    [secondV mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.offset(25);
        make.top.equalTo(firstV.mas_bottom).offset(13);
        make.right.offset(-25);
        make.height.offset(35.5);
    }];
    //在 imgV上添加 lab,btn
    UILabel *mutiLab = [[UILabel alloc]init];
    mutiLab.text = @"请选择多并发病症(多选):";
    mutiLab.textColor = [UIColor colorWithRed:116 / 255.0 green:191 / 255.0 blue:159 / 255.0 alpha:1];
    [mutiLab sizeToFit];
    
    [secondV addSubview:mutiLab];
    [mutiLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.offset(5);
        make.centerY.equalTo(secondV.mas_centerY).offset(0);
    }];
    _mutiLab=mutiLab;
    _secondV=secondV;
    
    //MARK:第三个：UIImageView
    UIView *thirdV = [[UIView alloc]init];
    thirdV.backgroundColor = [UIColor whiteColor];
    thirdV.layer.cornerRadius = 5;
    thirdV.layer.masksToBounds = YES;
    
    [self.view addSubview:thirdV];
    
    [thirdV mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.offset(25);
        make.top.equalTo(secondV.mas_bottom).offset(13);
        make.right.offset(-25);
        make.height.offset(35.5);
    }];
    
    //在 imgV上添加 lab,btn
    UILabel *sureLab = [[UILabel alloc]init];
    sureLab.text = @"是否已确诊：";
    sureLab.textColor = [UIColor colorWithRed:116 / 255.0 green:191 / 255.0 blue:159 / 255.0 alpha:1];
    [sureLab sizeToFit];
    
    [thirdV addSubview:sureLab];
    [sureLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.offset(5);
        make.centerY.equalTo(thirdV.mas_centerY).offset(0);
    }];

    //MARK:按钮1-1
    UIButton *chooseBtn1 = [[UIButton alloc]init];
    [chooseBtn1 setImage:[UIImage imageNamed:@"illness_rb_img_nor.png"] forState:UIControlStateNormal];
    [chooseBtn1 setImage:[UIImage imageNamed:@"illness_rb_img_sel.png"] forState:UIControlStateHighlighted];
    [chooseBtn1 setTitle:@" 已确诊" forState: UIControlStateNormal];
    chooseBtn1.font = [UIFont systemFontOfSize:15];
    
    [chooseBtn1 setTitleColor:[UIColor colorWithRed:116 / 255.0 green:191 / 255.0 blue:159 / 255.0 alpha:1] forState:UIControlStateNormal];
    [chooseBtn1 addTarget:self action:@selector(clickedChooseBtn:) forControlEvents:UIControlEventTouchUpInside];
    
    [thirdV addSubview:chooseBtn1];
    
    [chooseBtn1 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.offset(0);
        make.centerY.offset(0);
        make.size.mas_offset(CGSizeMake(65, 20));
    }];
    chooseBtn1.tag=11;
    _chooseBtn1=chooseBtn1;
    
    //MARK:按钮1-2
    UIButton *chooseBtn2 = [[UIButton alloc]init];
    [chooseBtn2 setImage:[UIImage imageNamed:@"illness_rb_img_nor.png"] forState:UIControlStateNormal];
    [chooseBtn2 setImage:[UIImage imageNamed:@"illness_rb_img_sel.png"] forState:UIControlStateHighlighted];
    [chooseBtn2 setTitle:@" 症状疑似" forState: UIControlStateNormal];
    chooseBtn2.font = [UIFont systemFontOfSize:15];
    
    [chooseBtn2 setTitleColor:[UIColor colorWithRed:116 / 255.0 green:191 / 255.0 blue:159 / 255.0 alpha:1] forState:UIControlStateNormal];
    
    [thirdV addSubview:chooseBtn2];
    
    [chooseBtn2 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(chooseBtn1.mas_right).offset(15);
        make.centerY.offset(0);
        make.size.mas_offset(CGSizeMake(100, 20));
    }];
    chooseBtn2.tag=12;
    [chooseBtn2 addTarget:self action:@selector(clickedChooseBtn:) forControlEvents:UIControlEventTouchUpInside];
    _chooseBtn2=chooseBtn2;
    
    
    //MARK:--第四个：UIImageView
    UIView *fourV = [[UIView alloc]init];
    fourV.backgroundColor = [UIColor whiteColor];
    fourV.layer.cornerRadius = 5;
    fourV.layer.masksToBounds = YES;
    
    [self.view addSubview:fourV];
    
    [fourV mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.offset(25);
        make.top.equalTo(thirdV.mas_bottom).offset(13);
        make.right.offset(-25);
        make.height.offset(35.5);
    }];
    
    //在 imgV上添加 lab,btn
    UILabel *yiliaoLab = [[UILabel alloc]init];
    yiliaoLab.text = @"是否有医疗史：";
    yiliaoLab.textColor = [UIColor colorWithRed:116 / 255.0 green:191 / 255.0 blue:159 / 255.0 alpha:1];
    [yiliaoLab sizeToFit];
    
    [fourV addSubview:yiliaoLab];
    [yiliaoLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.offset(5);
        make.centerY.equalTo(fourV.mas_centerY).offset(0);
    }];
    
    //MARK:按钮2-1
    UIButton *chooseBtn3 = [[UIButton alloc]init];
    [chooseBtn3 setImage:[UIImage imageNamed:@"illness_rb_img_nor.png"] forState:UIControlStateNormal];
    [chooseBtn3 setImage:[UIImage imageNamed:@"illness_rb_img_sel.png"] forState:UIControlStateHighlighted];
    [chooseBtn3 setTitle:@" 接受过" forState: UIControlStateNormal];
    chooseBtn3.font = [UIFont systemFontOfSize:15];
    
    [chooseBtn3 setTitleColor:[UIColor colorWithRed:116 / 255.0 green:191 / 255.0 blue:159 / 255.0 alpha:1] forState:UIControlStateNormal];
    _chooseBtn3=chooseBtn3;
    
    
    [fourV addSubview:chooseBtn3];
    
    [chooseBtn3 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.offset(0);
        make.centerY.offset(0);
        make.size.mas_offset(CGSizeMake(65, 20));
    }];
    chooseBtn3.tag=21;
    [chooseBtn3 addTarget:self action:@selector(clickedChooseBtn:) forControlEvents:UIControlEventTouchUpInside];
    
    //MARK:按钮2-2
    UIButton *chooseBtn4 = [[UIButton alloc]init];
    [chooseBtn4 setImage:[UIImage imageNamed:@"illness_rb_img_nor.png"] forState:UIControlStateNormal];
    [chooseBtn4 setImage:[UIImage imageNamed:@"illness_rb_img_sel.png"] forState:UIControlStateHighlighted];
    [chooseBtn4 setTitle:@" 未接受过" forState: UIControlStateNormal];
    chooseBtn4.font = [UIFont systemFontOfSize:15];
    
    [chooseBtn4 setTitleColor:[UIColor colorWithRed:116 / 255.0 green:191 / 255.0 blue:159 / 255.0 alpha:1] forState:UIControlStateNormal];

    chooseBtn4.tag=22;
    [chooseBtn4 addTarget:self action:@selector(clickedChooseBtn:) forControlEvents:UIControlEventTouchUpInside];
    _chooseBtn4=chooseBtn4;

    [fourV addSubview:chooseBtn4];
    
    [chooseBtn4 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(chooseBtn3.mas_right).offset(15);
        make.centerY.offset(0);
        make.size.mas_offset(CGSizeMake(100, 20));
    }];
    
    
    //MARK:第五个：UIImageView ---tap5
    UIView *fiveV = [[UIView alloc]init];
    fiveV.backgroundColor = [UIColor whiteColor];
    fiveV.layer.cornerRadius = 5;
    fiveV.layer.masksToBounds = YES;
    
    //设置隐藏
    [fiveV setHidden:YES];
    [self.view addSubview:fiveV];
    
    [fiveV mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.offset(25);
        make.top.equalTo(fourV.mas_bottom).offset(13);
        make.right.offset(-25);
        make.height.offset(35.5);
    }];
    [fiveV addGestureRecognizer:tap5];

    //在 imgV上添加 lab,btn
    UILabel *methodLab = [[UILabel alloc]init];
    methodLab.text = @"曾经的治疗方式：";
    methodLab.textColor = [UIColor colorWithRed:116 / 255.0 green:191 / 255.0 blue:159 / 255.0 alpha:1];
    [methodLab sizeToFit];
    _methodLab=methodLab;
    
    [fiveV addSubview:methodLab];
    [methodLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.offset(5);
        make.centerY.equalTo(fiveV.mas_centerY).offset(0);
    }];
    
    [firstV addGestureRecognizer:tap1];

    //匹配
    UILabel *piPeiLab = [[UILabel alloc]init];
    piPeiLab.text = @"一共为您匹配到";
    piPeiLab.textColor = [UIColor darkGrayColor];
    
    //设置隐藏
    [piPeiLab setHidden:YES];
    
    
    [self.view addSubview:piPeiLab];
    [piPeiLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(methodLab.mas_bottom).offset(70);
        make.centerX.offset(0);
    }];
    
    //医生数
    UILabel *doctorCount = [[UILabel alloc]init];
    doctorCount.text = @"24位医生";
    doctorCount.font = [UIFont systemFontOfSize:20];
    doctorCount.textColor = [UIColor colorWithRed:116 / 255.0 green:191 / 255.0 blue:159 / 255.0 alpha:1];
    
    //设置隐藏
    [doctorCount setHidden:YES];
    
    
    [self.view addSubview:doctorCount];
    [doctorCount mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(piPeiLab.mas_bottom).offset(20);
        make.centerX.offset(0);
    }];
    
    //医生头像
    UIImageView *doctorImgV = [[UIImageView alloc]init];
    doctorImgV.image = [[UIImage imageNamed:@"doctorCount"]imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
    doctorImgV.layer.cornerRadius = 20;
    doctorImgV.layer.masksToBounds = YES;
    
    //设置隐藏
    [doctorImgV setHidden:YES];
    
    
    [self.view addSubview:doctorImgV];
    [doctorImgV mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(doctorCount.mas_bottom).offset(20);
        make.centerX.offset(0);
    }];
    
    

    //预约 btn
    UIButton *yuYueBtn = [[UIButton alloc]init];
    [yuYueBtn setContentMode:UIViewContentModeCenter];
    [yuYueBtn setTitle:@"申请预约" forState: UIControlStateNormal];
    [yuYueBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
//    yuYueBtn.backgroundColor = [UIColor colorWithRed:116 / 255.0 green:191 / 255.0 blue:159 / 255.0 alpha:1];
    yuYueBtn.backgroundColor=[UIColor lightGrayColor];
    
    //给预约按钮添加监听事件
    [yuYueBtn addTarget:self action:@selector(yuYue:) forControlEvents:UIControlEventTouchUpInside];

    
    //设置按钮为圆形
    yuYueBtn.layer.cornerRadius = 10;
    yuYueBtn.layer.masksToBounds = YES;
    
    [self.view addSubview:yuYueBtn];
    
    [yuYueBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.offset(40);
        make.right.offset(-40);
        make.bottom.offset(-15);
        make.height.offset(40);
    }];
    
    _yuYueBtn=yuYueBtn;
    //记录
    _fiveV = fiveV;
    _piPeiLab = piPeiLab;
    _doctorCountLab = doctorCount;
    _iconV = doctorImgV;
    
}



//MARK:4- 点击申请预约跳转界面
- (void)yuYue:(UIButton *)sender
{

    BOOL isShow= [self showSVPWindow];
    
    if (!isShow) {
        return;
    }
    
//    if (!_chooseBtn1.selected) {
//        if (!_chooseBtn2.selected) {
//            [SVProgressHUD showErrorWithStatus:@"请先选择疾病类型"];
//            // 延迟1秒后消失
//            dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1.0 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
//                [SVProgressHUD dismiss];
//            });
//            return;
//        }
//        
//        
//    }
    
    JHSDoctorApplyViewController *vcOne=[[JHSDoctorApplyViewController
                                          alloc]init];

//    self.navigationController.navigationItem.backBarButtonItem.title=@"返回";
//    self.navigationController.navigationItem.backBarButtonItem.tintColor=[UIColor whiteColor];
//    
//    self.navigationController.title=@"医生预约";
    vcOne.isCanClickedCell=1;//调成可以点击
    [self.navigationController pushViewController:vcOne animated:YES];
    
}


//MARK:2- 实现手势监听方法
//第一个view
- (void)tap1:(UITapGestureRecognizer *)sender
{
    JHSSickTypeController *sickType = [[JHSSickTypeController alloc]init];

    
//    NSLog(@"btnTagg:------@%zd",self.btnTag);

    sickType.bigType=self.btnTag;
    sickType.delegate=self;
    
    
    
    [self.navigationController pushViewController:sickType animated:YES];
}

//第二个view
- (void)tap2:(UITapGestureRecognizer *)sender
{
    if ([self.typeLab.text isEqualToString:@"请选择疾病类型:"]){
        [SVProgressHUD showErrorWithStatus:@"请先选择疾病类型"];
        // 延迟2秒后消失
        dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1.0 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
            [SVProgressHUD dismiss];
        });
        
        return;
    }
    
    
    JHSMutiSickController *mutiSick = [[JHSMutiSickController alloc]init];
    
    if (self.syndromeTypeModelArr!=nil) {

        mutiSick.selectModelArr=self.syndromeTypeModelArr;

    }
    
    mutiSick.delegate=self;
    mutiSick.sicknessTypeModel=self.sicknessTypeModel;
    mutiSick.ci1_ID=self.btnTag;
    
    //把获取到的大类model用来查询
    [self.navigationController pushViewController:mutiSick animated:YES];
    
}
//第五个view
- (void)tap5:(UITapGestureRecognizer *)sender
{
    if ([self.typeLab.text isEqualToString:@"请选择疾病类型:"]){
        [SVProgressHUD showErrorWithStatus:@"请先选择疾病类型"];
        // 延迟2秒后消失
        dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1.0 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
            [SVProgressHUD dismiss];
        });
        
        return;
    }
    
    JHSOnceCureViewController *vc=[JHSOnceCureViewController new];
    
    vc.delegate=self;
    vc.navigationController.title=@"曾经的治疗方式";
    [self.navigationController pushViewController:vc animated:YES];
    
//    JHSSickTypeController *sickType = [[JHSSickTypeController alloc]init];
//    sickType.delegate=self;
//    [self.navigationController pushViewController:sickType animated:YES];
    
    
    
}


//MARK:按钮00-00点击事件
-(void)clickedChooseBtn:(UIButton *)btn{
    
   BOOL isShow= [self showSVPWindow];
    
    if (!isShow) {
        return;
    }
    
    if (btn.tag==11) {
        
        [_chooseBtn1 setImage:[UIImage imageNamed:@"illness_rb_img_sel.png"] forState:UIControlStateNormal];
        [_chooseBtn2 setImage:[UIImage imageNamed:@"illness_rb_img_nor.png"] forState:UIControlStateNormal];
        
    }
    else if (btn.tag==12){
        [_chooseBtn2 setImage:[UIImage imageNamed:@"illness_rb_img_sel.png"] forState:UIControlStateNormal];
        [_chooseBtn1 setImage:[UIImage imageNamed:@"illness_rb_img_nor.png"] forState:UIControlStateNormal];
    }
    else if(btn.tag==21)
    {

        if (btn.selected) {
            return;
        }
        
        _yuYueBtn.backgroundColor=[UIColor colorWithRed:116 / 255.0 green:191 / 255.0 blue:159 / 255.0 alpha:1];
        
        [_chooseBtn3 setImage:[UIImage imageNamed:@"illness_rb_img_sel.png"] forState:UIControlStateNormal];
        [_chooseBtn4 setImage:[UIImage imageNamed:@"illness_rb_img_nor.png"] forState:UIControlStateNormal];
        [_iconV setHidden:NO];
        [_fiveV setHidden:NO];
        [_piPeiLab setHidden:NO];
        [_doctorCountLab setHidden:NO];
        
    }
    else if(btn.tag==22){
        if (btn.selected) {
            return;
        }
        _yuYueBtn.backgroundColor=[UIColor colorWithRed:116 / 255.0 green:191 / 255.0 blue:159 / 255.0 alpha:1];
        
        [_chooseBtn4 setImage:[UIImage imageNamed:@"illness_rb_img_sel.png"] forState:UIControlStateNormal];
        [_chooseBtn3 setImage:[UIImage imageNamed:@"illness_rb_img_nor.png"] forState:UIControlStateNormal];
        [_iconV setHidden:NO];
        [_fiveV setHidden:YES];
        [_piPeiLab setHidden:NO];
        [_doctorCountLab setHidden:NO];
    }
}

//判断弹出框
-(BOOL) showSVPWindow{
    
    if ([self.typeLab.text isEqualToString:@"请选择疾病类型:"]){
        [SVProgressHUD showErrorWithStatus:@"请先选择疾病类型"];
        // 延迟1秒后消失
        dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1.0 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
            [SVProgressHUD dismiss];
        });
        return NO;
        //请选择多并发病症(多选):
    }else if ([self.mutiLab.text isEqualToString:@"请选择多并发病症(多选):"]){
        [SVProgressHUD showErrorWithStatus:@"请先选择多并发病症"];
        // 延迟1秒后消失
        dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1.0 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
            [SVProgressHUD dismiss];
        });
        return NO;
    }
    
    return YES;
}

@end
